<?php
defined("_VALID_ACCESS") || die('Direct access forbidden');
    class Eyeworx_Inventory_ContactLens_RBO_RBOContactLens extends RBO_Recordset {

//        public function display_total($record, $nolink=false) {
//            if (is_array($record)) {
//                $record = record_to_object($record);
//            }
//            $total = $record['total'] = $record['quantity'] * $record['price'];
//            $price_currency =  Utils_CurrencyFieldCommon::get_values($record->total);
//            return Utils_CurrencyFieldCommon::format(round($total,2),$price_currency[1]);
//        }

        public function fields() {
            $fields = array();

            $cl_brand = new RBO_Field_Text('Contact Lens Brand');
            $cl_brand->set_length(45)->set_required()->set_visible()->set_filter();
            $fields[] = $cl_brand;

            $cl_model = new RBO_Field_Text('Contact Lens Model');
            $cl_model->set_length(45)->set_visible()->set_required()->set_filter();
            $fields[] = $cl_model;

//            $cl_style = new RBO_Field_CommonData('Contact Lens Style', 'Eyeworx/Inventory/ContactLens/style');
//            $cl_style->set_visible()->set_required()->set_filter();
//            $fields[] = $cl_style;
//
//            $cl_color = new RBO_Field_MultiSelect('Contact Lens Color', 'eyeworx_color', array('color_name'));
//            $cl_color->set_required()->set_visible()->set_filter();
//            $fields[] = $cl_color;

            $price = new RBO_Field_Currency('Price per Qty');
            $price->set_required()->set_visible();
            $fields[] = $price;

            $qty = new RBO_Field_Integer('Total Qty');
            $fields[] = $qty;

            return $fields;
        }

        public function table_name() {
            return 'eyeworx_contact_lens';
        }

    }
?>